package com.ftg.mall.controller.pms;


import com.ftg.mall.base.entity.pms.ProductCategory;
import com.ftg.mall.base.util.bussiness.AbstractController;
import com.ftg.mall.base.util.tooltips.ResBean;
import com.ftg.mall.service.pms.IProductCategoryService;
import com.ftg.mall.service.impl.pms.ProductCategoryServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wangty
 * @createTime 2022/11/15
 */
@RestController
@RequestMapping("/product/category")
@Api(tags = "商品管理-商品分类")
public class ProductCategoryController extends AbstractController<ProductCategoryServiceImpl, ProductCategory> {

    @Resource
    IProductCategoryService iProductCategoryService;

    /**
     * 列出所有分类，以树形结构处理
     * @return
     */
    @GetMapping("/treeList")
    @ApiOperation("树形结构列表")
    public ResBean showTreeWithCategory(){
        return iProductCategoryService.showTreeWithCategory();
    }

}